<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
{% load i18n %}
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>{% block title %}MMO Organizer{% endblock %}</title>
<link rel="stylesheet" href="/css/style.css" type="text/css" media="screen,projection" />
<script type="text/javascript" src="/js/prototype.js"></script>
<script type="text/javascript" src="/js/main.js"></script>
{% if user %}
{% if user.get_profile.game %}
<link rel="stylesheet" href="/css/game_{{user.get_profile.game.id}}.css" type="text/css" media="screen,projection" />
{% endif %}
{% endif %}
{% block head %}
{% endblock %}
</head>
<body>
<div id="container">
	<div id="header">
		{% block header %}
		{% endblock %}
	</div>
	<div id="navigation">
		{% block navigation %}
			<h1><a href="/index">MMorganizer</a></h1>
			<ul id="nav">
				<li><a href="/index">index</a></li>
			{% if user.is_authenticated %}
				<li><a>Gestion</a>
					<ul>
					<li><a href="/characters/list">Mes persos</a></li>
					<li><a href="/characters/roster/list">Mes rosters</a></li>
					<li><a href="/events/list">Mes evenements</a></li>
					</ul>
				</li>
				<li><a href="/logout">Logout</a></li>
				
			{% else %}
				{% url mmorganizer.users.views.create as createCompteUrl %}
				<li><a href="{{ createCompteUrl }}">Creer un compte</a></li>
				<li><a href="/login">Se Connecter</a></li>
			{% endif %}
			</ul>
		{% endblock %}
	</div>
		{% if user.is_authenticated %}
		<div id="userData">
			{% if user.get_profile.defaultPersonnage %}
			<span id="persoInformations">
				{{ user.get_profile.defaultPersonnage }} - {{ user.get_profile.defaultPersonnage.serveur }}
			</span>
			{% endif %}
			<span id="changeData">
				<input type="hidden" id="nextValue" name="nextValue" value="{{ request.get_full_path }}"/>
				{% if user.personnage_set.all %}
				Personnage : 
				<select id="playerSelection" onchange="javascript:changePlayer()">
				{% for p in user.personnage_set.all %}
					<option value="{{ p.id }}" {% if user.get_profile.defaultPersonnage%} {% ifequal p.id user.get_profile.defaultPersonnage.id%} selected {% endifequal %} {% endif %} >{{ p.name }} </option>
				{% endfor %}
				</select>
				{% endif %}
				Jeu : 
				<select id="gameSelection" onchange="javascript:changeGame()">
				{% for g in user.get_profile.jeuxDisponibles %}
					<option value="{{ g.id }}" {% ifequal g.id user.get_profile.game.id %} selected {% endifequal %} >{{ g.name }} </option>
				{% endfor %}
				</select>
			</span>
		</div>
		{% endif %}
	<div id="content">
		{% block content %}
			default content
		{% endblock %}
	</div>
	<div id="footer">
		{% block footer %}
			default footer
		{% endblock %}
	</div>
</div>
</body>
</html>